package com.yuntian.mapper;


import com.yuntian.entity.Notice;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NoticeMapper {

     /**
      * 获取通知信息
      */
      @Select("select * from notice")
      List<Notice> getNotice();

      /**
       * 插入通知信息
       */
       @Insert("insert into notice (title, content, create_time, update_time, publish_time) " +
              "values (#{title}, #{content}, #{createTime}, #{updateTime}, #{publishTime})")
       void insert(Notice notice);
       /*
       * 更新通知信息
        */
       @Update("update notice set title=#{title}, content=#{content}, update_time=#{updateTime}, publish_time=#{publishTime} where notice_id=#{noticeId}")
       void update(Notice notice);

         /**
          * 删除通知信息
          */
         @Delete("delete from notice where notice_id=#{noticeId}")
         void delete(Integer noticeId);

}
